package string;

public class StringDemo {
    public static void main(String[] args) {
        String s1="123abc";
        String s2="123abc";
        System.out.println(s1==s2);
        String s3="123abc";
        System.out.println(s1==s3);
        String s4=new String("123abc");
        System.out.println(s1==s4);
        String s5="123"+"abc";//编译时换成123abc
        System.out.println(s1==s5);
        String s6="123";
        String s7=s6+"abc";//new对象
        System.out.println(s1==s7);
        s1=s1+"!";
        System.out.println(s1==s2);

    }
}
